<!--#include file="./doctype.html"-->
<title>日志文件管理首页-<%=siteTitle%>-后台管理</title>
</head><body>
<div class="wrap">
    <ol class="breadcrumb">
        <li class="active"><a href="<%=fileName%>">列表首页</a></li>
    </ol>
	<% if isArray(temp) and ubound(temp) > -1 then %>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th class="w10">#</th>
					<th>文件名</th>
					<th class="w15">时间</th>
					<th class="w15">操作</th>
					<th class="w15">大小</th>
					<th class="w15">类型</th>
				</tr>
			</thead>
			<tbody>
			<% for i = 0 to ubound(temp) %>
			    <% data = temp(i) %>
				<tr>
					<td>
						<input type="checkbox" name="fn" value="<%=data(0)%>" />
					</td>
					<td data-fn="<%=data(0)%>">
						<a class="detail" href="javascript:;"><%=data(0)%></a>
					</td>
					<td><%=data(1)%></td>
					<td data-fn="<%=data(0)%>">
					    <span title="下载" class="btn btn-xs text-success download">
					        <i class="glyphicon glyphicon-arrow-down"></i>
					    </span>
					    <span title="删除" class="btn btn-xs text-danger deleteOne">
					        <i class="glyphicon glyphicon-remove"></i>
					    </span>
					</td>
					<td><%=data(2)%></td>
					<td><%=data(3)%></td>
				</tr>
			<% next %>
			</tbody>
		</table>
		<!--#include file="page.html"-->
		<div class="btn-group">
            <span class="btn btn-sm btn-default selectFile">
                <i class="glyphicon glyphicon-th"></i> 全选/反选
            </span>
            <span class="btn btn-sm btn-default deleteBatch">
                <i class="glyphicon glyphicon-trash"></i> 删除
            </span>
        </div>
	<% else %>
		<div class="file_box">
		    <h3 class="text-primary">
		        <i class="glyphicon glyphicon-info-sign mr10"></i>
		        没有日志
		    </h3>
		</div>
	<% End if %>
    <!--#include file="loadTime.html"-->
</div>
<script>
$(document).ready(function(){
$(this)
	//全选、反选
	.on('click', '.selectFile', function() {
		$('input[name="fn"]').selectAll();
	})
	//批量删除
	.on('click', '.deleteBatch', function() {
        $.deleteBatch({
            data: $('input[name="fn"]').serializeArray()
        });
	})
	//单个删除
	.on('click', '.deleteOne', function() {
        $.deleteBatch({
            data: 'fn=' + encodeURIComponent($(this).parents().attr('data-fn'))
        });
	})
	//下载
	.on('click', '.download', function() {
        location.href = '<%=fileName%>?q=download&fn=' + encodeURIComponent($(this).parents().attr('data-fn'));
	})
	//查看
	.on('click', '.detail', function() {
        location.href = '<%=fileName%>?q=detail&fn=' + encodeURIComponent($(this).parents().attr('data-fn'));
	})
});
</script>
</body>
</html>